const BASE_URL='http://192.168.1.12:8088';

const http=({url,method='get',data={}})=>{
	let token = uni.getStorageSync('token') || ''
	if(!url)return
	let p=new Promise((resolve,reject)=>{
		uni.request({
			url:BASE_URL+url,
			data,
			method,
			header:{
			    token:token
			},
			success(res){
				resolve(res)
			},
			fail(err){
				reject(err)
			}
		})
	})
	return p
}

export default http